package com.dayuanit.dy16.ebook.ebookweb.mapper;

import com.dayuanit.dy16.ebook.ebookweb.domain.OrderDomain;
import com.dayuanit.dy16.ebook.ebookweb.entity.Order;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    int updateStatus(@Param("orderId") Long orderId,
                     @Param("oldStatus") Integer oldStatus,
                     @Param("newStatus") Integer newStatus);

    List<Order> listByStatus(@Param("status") Integer status, @Param("payChannel") Integer payChannel);

    List<Order> loadOrder(@Param("userId") Long userId, @Param("status") Integer status);

    List<OrderDomain> loadOrderAndDetail(@Param("userId") Long userId, @Param("status") Integer status);

}